package com.tianji.learning.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.tianji.common.domain.dto.PageDTO;
import com.tianji.common.domain.query.PageQuery;
import com.tianji.learning.dto.LearningPlanDTO;
import com.tianji.learning.entity.LearningLesson;
import com.tianji.learning.vo.LearningLessonVO;
import com.tianji.learning.vo.LearningPlanPageVO;

import java.util.List;

/**
 * @author 墨墨
 * @description 针对表【learning_lesson(学生课程表)】的数据库操作Service
 * @createDate 2024-10-25 23:08:39
 */
public interface LearningLessonService extends IService<LearningLesson> {

    /**
     * 添加课程到课表
     * @param userId
     * @param courseIds
     */
    void addUserLessons(Long userId, List<Long> courseIds);

    /**
     * 分页查询我的课表
     * @param query
     * @return
     */
    PageDTO<LearningLessonVO> queryMyLessons(PageQuery query);

    /**
     * 查询当前正在学习的课程
     * @return
     */
    LearningLessonVO queryMyCurrentLesson();


    /**
     * 判断课程是否在当前课表中
     * @param courseId
     * @return
     */
    Long isLessonValid(Long courseId);

    /**
     * 根据课程id查询课表信息
     * @param courseId
     * @return
     */
    LearningLessonVO queryLessonByCourseId(Long courseId);

    /**
     * 根据用户id和课程id查询课表信息
     * @param userId
     * @param courseId
     * @return
     */
    LearningLesson queryByUserAndCourseId(Long userId, Long courseId);


    void createLearningPlan(LearningPlanDTO planDTO);

    LearningPlanPageVO queryMyPlans(PageQuery query);
}
